<?php !defined("IN_SYSTEM") && exit("ACCESS DENY");?>
{template header}
{template top}
<div id="uc">
<div id="uc_main">

	{if $has}
	<div style="margin:25px 0;height:600px;">
	<font style="color:#557700;font-weight:bold;">你已经提交了申请，请耐心等待审核！</font>
	</div>
	{else}
	<div style="margin:25px 0">
	<font style="color:#557700;font-weight:bold;">请认真填写以下信息，提交后会有专门人员审核。</font>
	</div>
		<form name="user_add" method="post" action="{url('home.php?f=join&a=save')}"  enctype="multipart/form-data">
		<input type="hidden" id="rid" value="{$id}" name="rid"/>
		<input type="hidden" name="street1" value="" id="street1"/>
	<table cellspacing="0" class="uc_fa_table">
		<tr>
			<td class="td1">店主姓名：</td>
			<td ><input type="text" name="username" class="input" size="21" value="{$result['username']}" /></td>
			<td  class="td1">店主QQ：</td>
			<td ><input type="text" name="qq" class="input" size="21" value="{$result['qq']}" /></td>
		
		</tr>
		<tr>
			<td class="td1">店主手机：</td>
			<td ><input type="text" name="phone" class="input" value="{$result['phone']}" size="21" /></td>
			<td class="td2">店主电话：</td>
			<td><input type="text" name="tel" class="input" size="21" value="{$result['tel']}" /></td>
		
		</tr>
		<tr>
			<td class="td1">餐厅名称：</td>
			<td colspan="3"><input type="text" name="shopname" class="input" value="{$result['shopname']}" size="57" /></td>
		
		</tr>
		<tr>
			<td class="td1" >经营类型：</td>
			<td colspan="3" >
			<select name="stype" id="stype" >
			{loop $cates $cate}
			<option value="{$cate['cid']}" {if $cate['cid']== $result['cid']}selected{/if}>{$cate['catename']}</option>
			{/loop}
			</select>
			</td>
		</tr>
		<tr>
			<td class="td1" >外卖时间：</td>
			<td colspan="3" >
			从
			<select name="opentime" id="opentime">
			{loop $worktime1 $k $w}
			<option value="{$k}">{$w}</option>
			{/loop}
			</select>
			到
			<select name="closetime" id="closetime">
			{loop $worktime2 $k $w}
			<option value="{$k}">{$w}</option>
			{/loop}
			</select>
			<input type="checkbox" value="1"  name="res1">周六休息</input>
			<input type="checkbox" value="1" name="res2">周日休息</input>
			</td>
		</tr>
		<tr>
			<td class="td1">订餐电话：</td>
			<td  colspan="3"><input type="text" name="tel" class="input" value="{$result['tel']}" size="57" /></td>
		
		</tr>
		<tr>
			<td  class="td1">起送价：</td>
			<td  colspan="3"><input type="text" name="minprice" class="input" size="57" value="{$result['minprice']}" /></td>
		</tr>
		<tr>
			<td class="td1" >所属地区：</td>
			<td colspan="3" >{$region}</td>
		</tr>
		<tr>
			<td class="td1">详细地址：</td>
			<td colspan="3"><span id="address"></span><input type="text" name="addr1" class="input" size="30" value="{$result['addr1']}" /></td>
		</tr>
		
		<tr>
			<td class="td1">公交线路：</td>
			<td colspan="3"><input type="text" name="bus" class="input" size="57" value="{$result['bus']}" /></td>
		</tr>
		<tr>
			<td class="td1" valign="top">主营描述：</td>
			<td colspan="3"><textarea name="description" cols="56" rols="4">{$result['description']}</textarea>
		</tr>
		<tr>
			<td class="td1" valign="top">餐厅承诺：</td>
			<td colspan="3"><textarea name="chengnuo" cols="56" rols="4">{$result['chengnuo']}</textarea>
		</tr>
		<tr>
			<td class="td1" valign="top">餐厅特点：</td>
			<td colspan="3"><textarea name="tedian" cols="56" rols="4">{$result['tedian']}</textarea>
		</tr>
		<tr class="bg2"><td class="td1"></td><td colspan="3"><input type="submit" class="button" value="保存" /> </td></tr>
	</table>
	<script type="text/javascript">
			function region(obj,le){
				var val=$(obj).val();
				if(val<1 && le>0 && $("#level"+(le-1)).val() >0){
					$("#rid").val($("#level"+(le-1)).val());
				}else{
					$("#rid").val(val);
				}
				var ht='';
				var lev=le;
				if(val<1){
					lev=lev-1;
					if(lev<1){
						$('#address').html("");
						$('#street1').val("");
					}
				}
				for(var i=1;i<=lev;i++){
						ht=ht+$("#level"+i).find("option:selected").text();
						$('#address').html(ht);
						$('#street1').val(ht);
				}
				if($(obj).val()<1){
					$('#level'+(le+1)).remove();
					$('#level'+(le+2)).remove();
					$('#level'+(le+3)).remove();
					return ;
				}
				$.getJSON('home.php?m=addr&f=ajax&id='+$(obj).val()+'&tm='+Math.random(),'',function(data){
					if(data.status==true){
						$('#level'+(le+1)).remove();
						$('#level'+(le+2)).remove();
						$('#level'+(le+3)).remove();
						$(data.data).insertAfter($('#level'+le));
					}else{
					}
					});
			}
			</script>
	</form>
	{/if}

	


</div>
</div>

</div>
{template footer}